import { useEffect, useRef } from 'react'

// 第一次不执行监听hooks
function useUpdateEffect(effect, dependencies) {
  const isFirstRender = useRef(true)
  useEffect(() => {
    if (isFirstRender.current) {
      isFirstRender.current = false
      return
    }
    effect()
  }, dependencies)
}
export default useUpdateEffect
